<?php
// add new user page (add new user data to database )
//
// digiboard by digitalboom.org
// http://www.digitalboom.org
//
// Information Technology program
// Sirindhorn International Institute of Technology
// Thammasat University, Rangsit Campus
// http://www.siit.tu.ac.th
//
// author: hoho
// first created on: 2002 Mar 10
// last modified on: 2003 Aug 21 by bact'

include("settings/config.inc.php");

extract($_POST);
extract($_GET);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>new users registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$DGB["ENCODING"];?>">
<link rel="stylesheet" href="<?=$DGB["STYLESHEET"];?>" type="text/css">
</head>

<body bgcolor="#FFFFEE" >
<?php
if ($DGB["ENABLE_LOGIN"] == true) {
?>
<table width="100%" border=0 cellspacing=1 cellpadding=1 align="center">
 <tr> 
  <td class="pHead" align="center"> 
   <?=$DGB["WEBBOARD_NAME"];?> / new user registration
  </td>
 </tr>
 <tr> 
  <td class="pSubHead" align="center"> 
   <font color="#FFFFFF"><b>Please provide your information below</b></font>
  </td>
 </tr>
 <tr>
  <td>&nbsp;</td>
 </tr>
 <tr>
  <td> 
   <form name="form1" method="post" action="register.php">
    <table width=500 border=0 cellspacing=0 cellpadding=1 align="center" bgcolor="#cccccc">
     <tr>
      <td valign="top"> 
       <table width=500 border=0 cellspacing=0 cellpadding=1 align="center">
        <tr> 
         <td colspan=3 class="pHead">User details</td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td width=10><font color="#FF0000">*</font></td>
         <td width=200> 
          <? if (empty($Username)) { echo "<font color='red'><b>Username</b></font>"; } else { ?>
           Username 
          <? } ?>
         </td>
         <td width=290> 
          <input type="text" name="Username" size=20 maxlength=50 <? if (!empty($Username)) echo "value=\"$Username\""; ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td><font color="#FF0000">*</font></td>
         <td> 
          <?  if (empty($Password)) { echo "<font color='red'><b>Password</b></font>"; } else { ?>
          Password 
          <? } ?>
         </td>
         <td> 
          <input type="password" name="Password" size=20 maxlength=50>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td><font color="#FF0000">*</font></td>
         <td> 
          <? if (empty($ConfirmPassword)) { echo "<font color='red'><b>Confirm Password</b></font>"; } else { ?>
          Confirm Password 
          <? } ?>
         </td>
         <td width=290> 
          <input type="password" name="ConfirmPassword" size=20 maxlength=50>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td><font color="#FF0000">*</font></td>
         <td> 
          <? if (empty($Email)) { echo "<font color='red'><b>E-mail</b></font>"; } else { ?>
          E-mail 
          <? } ?>
         </td>
         <td> 
          <input type="text" name="Email" size=20 maxlength=255 <? if (!empty($Email)) echo "value=\"$Email\""; ?>>
         </td>
        </tr>
         <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>&nbsp;</td>
         <td align="right"> 
          <font color="#FF0000">*</font> must be completed
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>ICQ</td>
         <td> 
          <input type="text" name="ICQ" size=20 maxlength=50 <? if (!empty($ICQ)) echo "value=\"$ICQ\""; ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>MSN</td>
         <td> 
          <input type="text" name="MSN" size=20 maxlength=50 <? if (!empty($MSN)) echo "value=\"$MSN\""; ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Website</td>
         <td> 
          <input type="text" name="Website" size=20 maxlength=255
           <? if (!empty($Website)) echo "value=\"$Website\""; else echo "value=\"http://\"" ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td colspan=3>&nbsp;</td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Name</td>
         <td> 
          <input type="text" name="Name" size=20 maxlength=255 <? if (!empty($Name)) echo "value=\"$Name\""; ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Lastname</td>
         <td> 
          <input type="text" name="Lastname" size=20 maxlength=255 <? if (!empty($Lastname)) echo "value=\"$Lastname\""; ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Nickname</td>
         <td> 
          <input type="text" name="Nickname" size=20 maxlength=255 <? if (!empty($Nickname)) echo "value=\"$Nickname\""; ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Birthdate</td>
         <td> 
          <input type="text" name="BirthDate" value="dd/mm/yyyy" size=15
          onClick="javascript:if (document.form1.BirthDate.value=='dd/mm/yyyy') document.form1.BirthDate.value='';">
          dd/mm/yyyy ex. 20/01/1980
         </td>
        </tr>
        <tr valign="top" bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Address</td>
         <td> 
          <textarea name="Address" cols=30 rows=4></textarea>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Telephone</td>
         <td> 
          <input type="text" name="Telephone" size=20 maxlength=50>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td colspan=3>&nbsp;</td>
        </tr>
        <tr> 
         <td colspan=3 class="pHead">For SIIT student</td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>ID</td>
         <td> 
          <input type="text" name="SIITID" size=20 maxlength=50 <? if (!empty($SIITID)) echo "value=\"$SIITID\""; ?>>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>Program</td>
         <td> 
          <select name="Department">
           <option value="0">---</option>
           <option value="Freshy">Freshy</option>           
           <option value="BF">BF</option>
           <option value="CE">CE</option>        
           <option value="ChE">ChE</option>        	  
	   <option value="CS">CS</option>
           <option value="EP">EP</option>
           <option value="ET">ET</option>
           <option value="EV">EV</option>
           <option value="IE">IE</option>
           <option value="INS">INS</option>
           <option value="IT">IT</option>
           <option value="ME">ME</option>
           <option value="MT">MT</option>
           <option value="TC">TC</option>
          </select>
         </td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td colspan=3>&nbsp;</td>
        </tr>
        <tr bgcolor="#FFFFEE"> 
         <td>&nbsp;</td>
         <td>&nbsp;</td>
         <td> 
          <input type="submit" name="Submit" value="Submit">
          <input type="reset" name="Submit2" value="Reset">
         </td>
        </tr>
       </table>
      </td>
     </tr>
    </table>
   </form>
  </td>
 </tr>
</table>
<? } else { ?>
<h2 align="center">Sorry, login system is not enabled.</h2>
<? }?>

<br>
<?php
 include("html/footer.html");
?>
</body>
</html>
